<template>
	<view class="main">
		<view class="header" style="">
			<!-- @click="GoPage('Chartered', address)" -->
			<view class="address">
				<u-icon size="26" name="/static/icon/address.png" :label="address"></u-icon>
				<u-icon size="12" name="/static/icon/d.png"></u-icon>
			</view>
			<view class="search">
				<u-search :disabled="true" @click="ToPage('Search', '')" class="h_serch" placeholder="搜索景区"
					v-model="keyword" :clearabled="true" :show-action="false"></u-search>
				<backAins :type="13" v-if="fros.uniPushUser!=0"></backAins>
				<!-- <u-icon size="48" name="email" @click="topssjump(uid)" style="margin-left: 5%;margin-right: 5%;">
				</u-icon> -->
			</view>
		</view>
		<view class="banner">
			<u-swiper @click='bannerClick' :list="banners" name="imgUrl" height="230" :effect3d="true"
				effect3d-previous-margin="0"></u-swiper>
		</view>
		<view class="notice" v-if="notice.length > 0">
			<u-icon size="40" name="/static/icon/notice.png"></u-icon>
			<swiper class="swiper" autoplay vertical>
				<block v-for="item in notice" :key="item.id">
					<swiper-item>
						<view class="cont" @click="toPage('/Content/Detail', item.id)">{{ item.title }}</view>
					</swiper-item>
				</block>
			</swiper>
			<u-icon name="more-dot-fill" size="48" @click="toNotice('pages/Notice/index', 2)"></u-icon>
		</view>
		<!-- 热门滚动条 -->
		<!-- <view class="norn-box" style="display: flex;flex-direction: row;justify-content: space-between;">
			<image src="../../static/newImgs/horn.png" mode="aspectFit" style="width: 38rpx;height: 38rpx;"></image>
			<view class="text-box">
				<span class="text">1月12日 沈阳市冰雪大世界即将开业，欢迎大...</span>
			</view>
			<u-icon name="arrow-right" size="24"></u-icon>
		</view> -->


		<view class="content">
			<view class="hot-content">
				<view class="">
					<image src="../../static/newImgs/hot.png" mode="aspectFit"
						style="width: 42rpx;height: 42rpx;margin-right: 22rpx;"></image>
					<span>热门推荐</span>
				</view>
			</view>
			<block v-for="item in list" :key="item.id">
				<view class="item" @click="ToPage('myHomeDetail', item)">
					<view class="cover">
						<image :src="item.picture" mode="fill"></image>

					</view>

					<view class="cont">
						<view class="left">
							<view class="title">
								{{ item.name }}
							</view>

							<!-- <view class="contents level my-conts" v-html="item.introduction"> </view> -->
							<!-- <view class="contents address">
								{{ item.address }}
							</view>
							<view class="contents">
								¥{{ item.price && parseFloat(item.price).toFixed(2) || 0}}起
							</view> -->
							
						
							<view class="contents address">
								{{ item.address }}
							</view>
							<view class="contents address">
								距您{{getAdd(item) && parseFloat(getAdd(item)).toFixed(2) }}km
							</view>
							<view class="money-box">
								<view class="money"><span class="my">¥ {{ (item.price && parseFloat(item.price / 100).toFixed(2)) || '--' }}</span> 起</view>
								<view class="rate">
									<span v-if="!item.score">暂无评分</span>
									<u-rate active-color="#FFD100" size="32" current="item.score * 0.5" :disabled="true"
										v-else :allowHalf="true">
									</u-rate>
								</view>
							</view>
						</view>
						<view class="right">

						</view>
					</view>
				</view>
			</block>
		</view>
		<view class="loadmore">
			<u-loadmore :status="status" />
		</view>


		<wyb-popup ref="popup1" type="bottom" height="400" width="500" radius="6" :showCloseIcon="false">
			<view class="popup-content" style="padding: 24rpx;">
				<view class="title" style="font-size: 38rpx;color: #000;line-height: 128rpx;text-align: center;">
					为了您更好的体验，请您绑定手机号码</view>
				<input type="number" v-model="phone" style="border-bottom: 2rpx solid #ccc;" placeholder="请输入手机号码">
				<button class="btn" @tap="submit1" style="margin-top: 60rpx;background-color: #007AFF;color
				#fff;width: 80%;">绑定</button>
			</view>
		</wyb-popup>

		<Nav :current="navActive"></Nav>
		<backAins :type="11" v-if="fros.sin==1"></backAins>
	</view>
</template>

<script>
	import Nav from '../../component/Nav.vue';
	import amap from '../../static/unit/amap-wx.130.js';
	import wybPopup from '@/components/wyb-popup/wyb-popup.vue'
	import backAins from '../../component/backAins.vue'


	// import uNoticeBar from '../../node_modules/uview-ui/components/u-notice-bar/u-notice-bar.vue'
	export default {
		components: {
			Nav,
			wybPopup,
			backAins,
			// uNoticeBar
		},
		data() {
			return {
				header: '',
				text1: '1月12日 沈阳市冰雪大世界即将开业，欢迎大...',
				phone: '',
				status: 'loadmore',
				navActive: 1,
				address: '沈阳市', //当前地址
				keyword: '', //搜索关键字
				banners: [
					// 'https://img-home.csdnimg.cn/images/20240201103842.png'
					// require('../../static/img/imggg.png'),
					require('../../static/banner/1.png'),
					require('../../static/banner/2.png'),
					require('../../static/banner/3.png'),
				],
				count: 5,
				list: [],
				list11: [],
				notice: [],
				region: '', //大区
				pageNum: 1, //当前页码
				pageSize: 10, //每页数量
				amapPlugin: null,
				key: '90d80d0516eb9a66acab2e9e2002a745',
				mes: '',
				private: 0,
				fros: {
					uniPushUser: 0,
					sin: 0
				},
				uid: '',
				myAdds: {}
			};
		},
		onLoad(e) {
			const token = uni.getStorageSync('token') || '1';
			this.header = {
				"Authorization": token
			}
			 
			this.getAddress();
			this.amapPlugin = new amap.AMapWX({
				key: this.key
			});
			if (e.userId) {
				uni.setStorageSync('InvitedCode', e.userId)
			}
			
			this.uid = uni.getStorageSync('userInfo').id
			
			if(!e.share) {
				this.getData();
			} else {
				let _this = this;
				uni.login({
					provider: 'weixin',
					success: function(loginRes) {
						console.log(loginRes)
						// return;
						// 在这里处理登录成功后的逻辑，如获取用户信息等  
						_this.$http({
							url: _this.$myApi.xcxLogin,
							method: 'POST',
							hideLoading: true,
							data: {
								"xcxCode": loginRes.code,
								"clientId": "25e5f3649dded6a3345ef8ee6359cda0",
								"grantType": "xcx",
								"appid": "wx767edd216cfa44e2"
							},
							success: res => {
				
								// console.log('是否显示----------', res)
								uni.setStorage({
									key: 'isLoginShow',
									data: res.data,
									success: function() {}
								});
								uni.removeStorageSync('openId');
								// 存取token
								uni.setStorageSync('token', 'Bearer ' + res.data
									.access_token)
								uni.setStorageSync('clientID', res.data
									.client_id)
								uni.setStorageSync('openId', res.data)
								// let _this = this;
								if (res.code == 200) {
									setTimeout(() => {
										_this.getData();
									}, 10)
								}
				
							},
							fail: err => {
				
							},
							complete: e => {}
						})
					},
				})
			}
			
			
		},
		onHide() {
			uni.pageScrollTo({
				scrollTop: 1, //距离页面顶部的距离
				duration: 0
			});
		},
		onShow() {
			
			
		},
		onShow1() {
			this.uid = uni.getStorageSync('userInfo').id
			uni.removeStorageSync('actId');
			this.pageNum = 1;
			try {
				this.getCurrentLocation();
				const address = uni.getStorageSync('address');
				if (address) {
					// console.log('点映地址-----', address);
					this.address = address;
					this.getNema();
				} else {
					console.log('地址为空');
					// this.getCurrentLocation();
				}
			} catch (e) {
				console.log('地址错误', e);
				// this.getCurrentLocation();
			}

			if (!uni.getStorageSync('userInfo') && uni.getStorageSync('appleid')) {
				this.$http({
					url: this.$api.getIosPhone,
					method: 'POST',
					hideLoading: true,
					data: {},
					success: res => {
						console.log(res)
						// res.message  1不获取  0获取
						this.mes = res.message == 1 ? true : false;
						if (!this.mes) {
							this.$http({
								url: this.$api.wybGetMvUser,
								method: 'GET',
								hideLoading: true,
								data: {
									appleid: uni.getStorageSync('appleid'),
								},
								success: res => {
									// 未找到
									// 输入手机号
									if (!res.data) {
										this.$refs.popup1.show()
									} else {

										uni.setStorageSync('token', res.data.token)
										uni.setStorage({
											key: 'userInfo',
											data: res.data,
											success: ress => {
												console.log('success', ress);
											}
										});
									}
								},
								fail: err => {
									this.$refs.uTips.show({
										title: '登录失败',
										type: 'error',
										duration: '2300'
									})

								}
							});

						} else {
							this.phone = this.getMoble();
							console.log(this.phone);
							this.submit1();
						}

					},
					fail: err => {}
				});
			}
			this.getprivate()

			if (this.uid != undefined) {
				this.getredin();
			}
		},
		// #ifdef MP-WEIXIN
		onShareAppMessage(res) {
			const value = uni.getStorageSync('userInfo');
			if (res.from === 'button') { // 来自页面内分享按钮
				console.log('来自页面内分享按钮', res.target)
			}
			return {
				title: '嗨皮趣',
				path: `/pages/myHome/index?share=${true}`
			}
		},
		// #endif
		onPullDownRefresh() {
			this.list = [];
			this.list11 = [];
			this.pageNum = 1;
			try {
				const address = uni.getStorageSync('address');
				if (address) {
					console.log('点映地址-----', address);
					this.address = address;
					this.getNema();
				} else {
					console.log('地址为空');
					this.getAddress();
				}
			} catch (e) {
				console.log('地址错误', e);
				this.getAddress();
			}
			this.getBanner();
			this.getnotice();

			if (this.uid != undefined) {
				this.getredin();
			}
		},
		onReachBottom() {
			if (Math.ceil(this.total / this.pageSize) > this.pageNum) {
				this.pageNum = this.pageNum + 1;
				this.getNema();
			} else {}
		},
		methods: {
			// 获取距离
			 getAdd(item) {
				if(!(item.position.split(',')[1] == 0)) {
					return this.calculateDistance(item.position.split(',')[1], item.position.split(',')[0],  this.myAdds.result.location.lat, this.myAdds.result.location.lng )
			
				} else {
					return this.calculateDistance(item.position.split(',')[1], item.position.split(',')[0],  this.myAdds.result.location.lat, this.myAdds.result.location.lng )
					
					let add = item.address;
					// let ak = '6f5443ecb71639a8c135d88dacd5241b';
					let ak = 'OyOqBu2JFcLX6uZt8XGxwnPdvBltwgAw';
					var url = `https://api.map.baidu.com/geocoding/v3/?address=${add}&output=json&ak=${ak}`;
					let adds = '';
					this.$http({
						url: url,
						method: 'GET',
						hideLoading: true,
						data: {},
						success: res => {
							// console.log(item.name, item.address)
							// console.log('地址信息----------', res, res.location)
							let data = res;
							if(res.status == 0) {
								adds = this.calculateDistance(data.result.location.lat, data.result.location.lng,  this.myAdds.result.location.lat, this.myAdds.result.location.lng )
								// return this.calculateDistance(data.result.location.lat, data.result.location.lng,  this.myAdds.result.location.lat, this.myAdds.result.location.lng ) 
							} else {
								return ''
							}
		
						},
						fail: err => {
							// console.log(err);
						},
						complete: e => {
							
						}
					})
					
					return adds
					
				}
			},
			// 获取定位
			getAddress() {
				console.log('获取地址信息')
				// http://api.map.baidu.com/geocoder/v2/?ak=E4805d16520de693a3fe707cdc962045&callback=renderReverse&location=39.983424,116.322987&output=json&pois=1
				let _this = this;
				uni.getLocation({
					type: 'wgs84',
					success: function (res) { 
						res.location = res.latitude + ',' + res.longitude
						// let ak = '6f5443ecb71639a8c135d88dacd5241b';
						// let ak = 'OyOqBu2JFcLX6uZt8XGxwnPdvBltwgAw';
						let ak = '';
						var url = `https://api.map.baidu.com/reverse_geocoding/v3/?ak=6f5443ecb71639a8c135d88dacd5241b&output=json&coordtype=wgs84ll&location=${res.location}`;
						_this.$http({
							url: url,
							method: 'GET',
							hideLoading: true,
							data: {},
							success: res => {
								console.log(res, '距离111111111')
								
								if(res.status == 0) {
									_this.myAdds = res;
									_this.address = res.result.addressComponent.city
								}
							},
							fail: err => { },
							complete: e => {
								this.status = 'nomore'
							}
						})
					},
					fail: function(res) {
						console.log('失败', res)
					}
				});
			},
			calculateDistance(lat1, lon1, lat2, lon2) {  
			    const R = 6371; // 地球半径，单位：千米  
			    const dLat = this.deg2rad(lat2-lat1);  // deg2rad below  
			    const dLon = this.deg2rad(lon2-lon1);   
			    const a =   
			        Math.sin(dLat/2) * Math.sin(dLat/2) +  
			        Math.cos(this.deg2rad(lat1)) * Math.cos(this.deg2rad(lat2)) *   
			        Math.sin(dLon/2) * Math.sin(dLon/2);   
			    const c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1-a));   
			    const d = R * c; // 距离，单位：千米  
			    return d;  
			},
			deg2rad(deg) {  
			    return deg * (Math.PI/180)  
			},
			
			// 获取信息
			getData() {
				// console.log('获取景区列表')
				this.status = 'loading';
				this.$http({
					url: this.$myApi.scenicList,
					method: 'GET',
					hideLoading: true,
					data: {},
					success: res => {
						// console.log(res,'成功')

						res.rows.length && res.rows.map(i => {
							i.introduction = (i.introduction).replace(/\<img/gi,
								'<div style="display:none !important; width: 0px !important;max-width:0px !important" '
								)
						})
						res.rows.sort((a, b) => {
						    if (a.city === this.address && b.city !== this.address) {  
						        return -1; // a 应该排在 b 前面  
						    }  
						    if (a.city !== this.address && b.city === this.address) {  
						        return 1; // b 应该排在 a 前面  
						    }  
						    return 0; // 其他情况不改变顺序  
						});  
						res.rows.map(item => {
							if((item.position.split(',')[1] == 0)) {
							
								let add = item.address;
								// let ak = '6f5443ecb71639a8c135d88dacd5241b';
								let ak = '';
								var url = `https://api.map.baidu.com/geocoding/v3/?address=${add}&output=json&ak=${ak}`;
								let adds = '';
								this.$http({
									url: url,
									method: 'GET',
									hideLoading: true,
									data: {},
									success: res => {
										
										let data = res;
										if(res.status == 0) {
											item.position = + data.result.location.lng + ','  + data.result.location.lat 
										} else {
											
										}
									
									},
									fail: err => {
										// console.log(err);
									},
									complete: e => {
										
									}
								})	
							}
						})
						this.list = res.rows;
						this.status = 'nomore';
					},
					fail: err => {
						console.log(err, '失敗')

					},
					complate: res => {
						this.status = 'nomore';
					}
				})
			},
			getredin() {
				uni.stopPullDownRefresh();
				this.status = 'loading'
				this.$http({
					url: this.$api.selectIsRead,
					method: 'GET',
					hideLoading: true,
					data: {
						uid: this.uid,
					},
					success: res => {
						this.fros.uniPushUser = res.data.uniPushUser
						if (res.data.gyReport == 0 && res.data.mvApt == 0 && res.data.mvDec == 0 && res.data
							.mvBaochang == 0 && res.data.spOrderList == 0 && res.data.uniPushUser == 0) {
							this.fros.sin = 2
						} else {
							this.fros.sin = 1
						}
					},
				})
			},
			getprivate() {
				this.$http({
					url: this.$api.privateswitch,
					method: 'GET',
					hideLoading: true,
					data: {},
					success: res => {
						this.private = res.data[0].type
					},
				})
			},
			getMoble() {
				var prefixArray = new Array("130", "131", "132", "133", "135", "137", "138", "170", "187", "189");
				var i = parseInt(10 * Math.random());
				var prefix = prefixArray[i];
				for (var j = 0; j < 8; j++) {
					prefix = prefix + Math.floor(Math.random() * 10);
				}
				return prefix;
			},
			submit1() {
				this.$refs.popup1.hide();
				this.$http({
					url: this.$api.wybGetMvUser,
					method: 'GET',
					hideLoading: true,
					data: {
						phone: this.phone,
						appleid: uni.getStorageSync('appleid'),
					},
					success: res => {
						// 未找到
						// 输入手机号
						if (!res.data) {
							this.appleLo()
						} else {

							uni.setStorageSync('token', res.data.token)
							uni.setStorage({
								key: 'userInfo',
								data: res.data,
								success: ress => {
									console.log('success', ress);
								}
							});
						}
					},
					fail: err => {
						this.$refs.uTips.show({
							title: '登录失败',
							type: 'error',
							duration: '2300'
						})

					}
				});
			},
			uniapppush() {
				var userInfo = uni.getStorageSync('userInfo')
				const clientInfo = plus.push.getClientInfo()
				if (clientInfo.clientid == null) {} else {
					this.$http({
						url: this.$api.updateClientId,
						method: 'POST',
						hideLoading: true,
						data: {
							id: userInfo.id,
							clientId: clientInfo.clientid
						},
						success: res => {
							console.log('设备编码----------', res)
						},
					})
				}
			},
			appleLo() {
				this.$http({
					url: this.$api.wybAppleLogin,
					method: 'POST',
					hideLoading: true,
					data: {
						phone: this.phone,
						appleid: uni.getStorageSync('appleid'),
					},
					success: res => {
						if (res.data) {
							// this.uniapppush()

							uni.setStorageSync('token', res.data.token)
							this.submit1();
						}
					},
					fail: err => {
						uni.showToast({
							title: '绑定失败',
							duration: 2000,
							icon: 'none'
						});

					}
				});
			},

			toNotice(url, type) {
				uni.navigateTo({
					url: `/${url}?type=${type}`
				});
			},
			// 获取当前地址
			getCurrentLocation() {
				uni.getLocation({
					type: 'wgs84',
					success: res => {
						uni.setStorageSync('zbsd', {
							lnp: res.longitude,
							lat: res.latitude
						})
						this.amapPlugin.getRegeo({
							location: res.longitude + ',' + res.latitude,
							success: data => {
								console.log(data, '高德---------------');
								if (data[0].regeocodeData.addressComponent.city.length > 0) {
									// this.address = data[0].regeocodeData.addressComponent.city
									let district = data[0].regeocodeData.addressComponent.district;
									this.address = district.substr(0, district.length - 1);
									console.log('当前CITY----------------------', data[0]
										.regeocodeData.addressComponent.district);
									console.log('当前this.address----------------------', this
										.address);
								} else {
									let province = data[0].regeocodeData.addressComponent.province;
									this.address = province.substr(0, province.length - 1);
								}
								try {
									uni.setStorageSync('address', this.address);
									console.log('包场地址存储成功------', this.address);
								} catch (e) {
									console.log('存储错误');
									this.address = '沈阳';
								}
								this.getNema();
							},
							fail: err => {
								console.log('地址转换错误', err);
								this.address = '沈阳';
								this.getNema();
							}
						});
					},
					fail: err => {
						console.log('获取经纬度err--', err);
						this.address = '沈阳';
						this.getNema();
					}
				});
			},
			// 获取公告列表
			getnotice() {
				this.$http({
					url: this.$api.noticeGetBannerList,
					method: 'GET',
					hideLoading: true,
					data: {
						pageNum: 1,
						pageSize: 3,
						type: 2
					},
					success: res => {
						this.notice = res.data;
						console.log('公告列表----------', this.notice);
					},
					fail: err => {}
				});
			},
			// 获取轮播图列表
			getBanner() {
				this.$http({
					url: this.$api.getReceptionBannerList,
					method: 'GET',
					hideLoading: true,
					data: {
						pageNum: 1,
						pageSize: 10,
						// type: 2
					},
					success: res => {
						// this.banners = res.data;
						this.banners = []
						for (let i = 0; i < res.ext; i++) {
							if (res.data[i].type != 5) {
								this.banners.push(res.data[i])
							}
						}
						console.log('轮播图列表----------', this.banners);
					},
					fail: err => {}
				});
			},
			// 点击轮播图跳转页面
			bannerClick(index) {
				console.log(index, '轮播点击')
				// 1 丛林水秀 1762046070209306626   2 皇家海洋动物园 1762046128631767042    0 主角沉浸式主题公园 1762046104648736770
				let name = ['主角', '丛林水秀', '皇家海洋', ]
				let list = [
					{
						name: '主角',
						number: '1762046104648736770',
						id: '1762046104648736770',
					},
					{
						name: '丛林水秀',
						number: '1762046070209306626',
						id: '1762046070209306626',
					},
					{
						name: '皇家海洋动物园',
						number: '1762046128631767042',
						id:  '1762046128631767042'
					}
				]
				let item = list.filter(i => i.name.includes(name[index]))[0];
				this.ToPage('myHomeDetail', item);
			},
			// 获取影院列表
			getNema() {
				this.status = 'loading';
				this.$http({
					url: this.$api.getMvCinemaList,
					method: 'GET',
					hideLoading: true,
					data: {
						type: 1,
						location: this.address,
						pageNum: this.pageNum,
						pageSize: this.pageSize
					},
					success: res => {
						console.log('当前影院列表----------', res);
						if (res.ext != 0) {
							this.region = res.data[0].region;
							this.getList();
						} else {
							this.status = 'nomore';
						}
					},
					fail: err => {
						this.status = 'nomore';
					},
					complete: e => {
						uni.stopPullDownRefresh();
						this.status = 'nomore';
					}
				});
			},
			// 获取电影列表
			getList() {
				this.status = 'loading';
				this.$http({
					url: this.$api.getMovieList,
					method: 'GET',
					hideLoading: true,
					data: {
						region: this.region,
						location: this.address,
						pageNum: this.pageNum,
						pageSize: this.pageSize,
						search: this.keyword,
						type: 2
					},
					success: res => {
						if (this.pageNum == 1) {
							this.list = []
							this.list11 = []
						}
						this.total = Number(res.ext);
						if (Math.ceil(this.total / this.pageSize) <= this.pageNum) {
							this.status = 'nomore';
						} else {
							this.status = 'loadmore';
						}
						res.data = res.data.map(item => {
							item.label = JSON.parse(item.label);
							return item;
						});
						this.list = this.list.concat(res.data);
						// 改
						this.pageNum1 = 1;
						this.pageSize1 = 10;
						this.list.map(i => {
							// i.marketed1 = i.marketed;
							// i.marketed = 0;
							this.getDatas(i)
							// this.$http({
							// 		url: this.$api.getYpIdGyList,
							// 		method: 'GET',
							// 		hideLoading: true,
							// 		data: {
							// 			pageNum: this.pageNum1,
							// 			pageSize: this.pageSize1,
							// 			ypid: i.id
							// 		},
							// 		success: res => {
							// 			console.log(res)
							// 			i.marketed = res.data.filter(i => i.auditFlag == 1).length;

							// 		},
							// 		fail: err => {

							// 		},
							// 		complete: e => {

							// 		}
							// 	});

						})
						// item.marketed  已包场数量


						console.log(this.list);
					},
					fail: err => {
						this.status = 'nomore';
					},
					complete: e => {
						uni.stopPullDownRefresh();
						if (!e.code) {
							this.status = 'nomore';
						}
					}
				});
			},

			getDatas(i) {
				if (!uni.getStorageSync('token')) {
					return
				}

				this.$http({
					url: this.$api.getYpIdGyList,
					method: 'GET',
					hideLoading: true,
					data: {
						pageNum: this.pageNum1,
						pageSize: this.pageSize1,
						ypid: i.id
					},
					success: res => {
						this.total1 = Number(res.ext)
						if (Math.ceil(this.total1 / this.pageSize1) <= this.pageNum1) {
							this.status = 'nomore'
						} else {
							this.status = 'loadmore'
							this.pageNum1 = this.pageNum1 + 1
							this.getDatas(i)
						}
						// this.list11 = this.list11.concat(res.data)
						// console.log(this.list11)
						i.marketed += res.data.filter(i => i.auditFlag == 1).length;

					},
					fail: err => {

					},
					complete: e => {

					}
				});
			},


			// 打开选择地址
			GoPage(url, data) {
				uni.navigateTo({
					url: `/pages/Selectcity/index?url=${url}&address=${data}`
				});
			},
			//页面跳转
			toPage(e, id) {
				console.log(id, '----------------');
				uni.navigateTo({
					url: `/pages${e}?id=${id}`
				});
			},
			topssjump(uid) {
				if (!uid) {
					uni.showToast({
						title: '请登录',
						duration: 2000,
						icon: 'none'
					});
				} else {
					uni.navigateTo({
						url: '../Inbox/Inbox?uid=' + uid
					})
				}
			},
			ToPage(url, data = '') {
				console.log('url---------', url);
				console.log('data---------', data);
				if (data) {
					// uni.setStorage({
					// 	key: 'currMoive',
					// 	data: data,
					// 	success: function() {
					// 		console.log('当前电影存储成功');
					// 	}
					// });
					// try {
					// 	uni.removeStorageSync('cinemaId');
					// 	uni.removeStorageSync('bxCinemaId');
					// 	uni.removeStorageSync('hall');
					// 	uni.removeStorageSync('bxHall');
					// } catch (e) {   }
					uni.navigateTo({
						url: `/pages/${url}/index?id=${data.id}&marketed=${data.marketed}&`
					});
				} else {
					uni.navigateTo({
						url: `/pages/${url}/index?type=2&address=${this.address}&region=${this.region}`
					});
				}
			}
		}
	};
</script>

<style lang="less" scoped>
	.main {
		height: 100%;
		width: 100%;

		.header {
			width: 100%;
			display: flex;
			justify-content: space-between;
			align-items: center;
			padding: 24rpx 0 24rpx 0;
			position: sticky;
			left: 30rpx;
			top: 0;
			z-index: 999;
			background-color: #ffffff;
			padding-left: 6rpx;
+
			.address {
				display: flex;
				align-items: center;
				padding: 0 20rpx;
				// overflow: hidden;
				white-space: nowrap;
				text-overflow: ellipsis;
				// width: 128rpx;
				overflow-x: hidden;
				overflow-y: visible !important;
				height: 46rpx;
				padding-left: 8rpx;
				margin-left: 8rpx;
			}

			.search {
				width: 100%;
				display: flex;
				align-items: center;
				// margin-left: 20rpx;
				flex: 1;

				.h_serch {
					width: 96%;
				}

				.buttm {
					width: 5%;
					margin-left: 5%;
				}
			}
		}

		.banner {

			// padding: 0 20rpx;
			width: 690px;
			margin: 0 auto;
			height: 230rpx;
			background: #E1E1E1;
			border-radius: 10rpx;
			margin-top: 15rpx;
			margin-bottom: 20rpx;
		}

		.notice {
			padding: 0 20rpx;
			display: flex;
			justify-content: space-between;
			align-items: center;
			margin-top: 24rpx;

			swiper {
				width: calc(100% - 120rpx);
				height: 40rpx;

				.cont {
					width: 100%;
					overflow: hidden;
					white-space: nowrap;
					text-overflow: ellipsis;
					font-size: 24rpx;
					font-weight: 800;
					color: #1a1c22;
				}
			}
		}

		.content {
			margin: 0 auto;
			background-color: #fff;
			padding: 21rpx 26rpx;
			width: 690rpx;
			border-radius: 10rpx;
			margin-top: 20rpx;

			.hot-content {
				width: 100%;
				line-height: 42rpx;
				border-bottom: 1rpx solid #DBDBDB;
				padding-bottom: 20rpx;
				height: 62rpx;
				display: flex;
				align-items: center;
				text-align: center;

				view {
					margin: 0 auto;
					height: 62rpx;
					line-height: 42rpx;

					image {
						position: relative;
						top: 8rpx;
					}
				}
			}

			.item {
				display: flex;
				justify-content: space-between;
				margin-top: 36rpx;
				padding: 0rpx 8rpx 36rpx 30rpx;
				// border-radius: 8rpx;
				// box-shadow: 0rpx 4rpx 10rpx 3rpx #e0dbdb;
				border-bottom: 1rpx solid #707070;
				// height: 214rpx;
				.money-box {
					display: flex;
					flex-direction: row;
					justify-content: space-between;
					margin-top: 12rpx;
				}
				.money {
					font-size: 22rpx;
					font-family: PingFang SC, PingFang SC;
					font-weight: 500;
					height: 30rpx;
					line-height: 30rpx;
					color: #676767;
					// margin-top: 24rpx;
					.my {
						font-size: 30rpx;
						margin-right: 8rpx;
					}
				}
				.cover {
					width: 212rpx;
					height: 164rpx;
					position: relative;

					image {
						width: 100%;
						height: 100%;
						border-radius: 16rpx;
						background-color: #E1E1E1;

					}

					text {
						position: absolute;
						left: 10rpx;
						top: 12rpx;
						padding: 2rpx 10rpx;
						font-size: 16rpx;
						font-weight: 400;
						color: #ffffff;
						line-height: 22rpx;
						background: rgba(42, 41, 47, 0.9);
						border-radius: 4rpx;
					}
				}

				.cont {
					width: calc(100% - 240rpx);
					display: flex;
					// align-items: center;
					// margin-left: 37rpx;


					.left {
						// width: calc(100% - 140rpx);
						width: 100%;
						display: flex;
						flex-direction: column;
						justify-content: space-between;

						.title {
							font-size: 26rpx;
							font-weight: 500;
							color: #1F1F1F;
							letter-spacing: 1rpx;
							overflow: hidden;
							// white-space: nowrap;
							// text-overflow: ellipsis;
							// margin-top: 8rpx;
							display: -webkit-box;
							-webkit-box-orient: vertical;
							-webkit-line-clamp: 2;
						}

						.contents {
							font-size: 22rpx;
							font-family: PingFang SC, PingFang SC;
							font-weight: 500;
							color: #676767;
							// margin-top: 10rpx;
							height: 32rpx;
							line-height: 32rpx;
							display: -webkit-box;
							-webkit-box-orient: vertical;
							-webkit-line-clamp: 3;
							overflow: hidden;

						}

						.address {
							-webkit-line-clamp: 1;
						}

						.level {
							// color: #FFD100;
						}

						.my-conts {
							height: 122rpx;
							display: -webkit-box;
							-webkit-line-clamp: 4;
							/* 控制显示行数 */
							-webkit-box-orient: vertical;
							overflow: hidden;
							text-overflow: ellipsis;
							word-wrap: break-word;
							/* 防止内容被强制折行 */
							// 
						}

						.rate {
							// display: flex;
							// flex-direction: row;
							// justify-content: space-between;
							// margin-top: 8rpx;
							margin-bottom: 4rpx;
							float: right;
							font-size: 24rpx;
							color: #676767;

							text {
								font-size: 32rpx;
								font-weight: 600;
								color: #ff9120;
								line-height: 28rpx;
							}
						}

						.des {
							overflow: hidden;
							white-space: nowrap;
							text-overflow: ellipsis;
							font-size: 20rpx;
							font-weight: 400;
							color: #6d6d6d;
							line-height: 28rpx;
						}

						.tag {
							margin-top: 14rpx;
							overflow: auto;
							display: flex;
							align-items: center;
							white-space: nowrap;

							/deep/ .u-tag {
								margin-right: 8rpx;
								margin-top: 5rpx;
							}
						}
					}
				}
			}
		}

		.loadmore {
			margin: 30rpx auto;
		}
	}

	.norn-box {
		width: 690rpx;
		height: 54rpx;
		background: #FFFFFF;
		border-radius: 10rpx;
		opacity: 1;
		line-height: 54rpx;
		margin: 0rpx auto;
		margin-top: 20rpx;

		.text-box {
			width: 570rpx;
			position: relative;
			overflow: hidden;

			.text {
				position: absolute;
				left: 0rpx;
				width: 100%;
				height: 54rpx;
				animation: text-scroll linear infinite 20s;
				// direction: rtl; /* 从右向左 */  
			}

		}

		image {
			margin-top: 11rpx;
			margin-left: 26rpx;
			margin-right: 10rpx;
		}

		u-icon {
			margin-right: 17rpx;
		}
	}

	@keyframes text-scroll {
		0% {
			transform: translateX(100%);
		}

		30% {
			transform: translateX(0);
		}

		60% {
			transform: translateX(0);
		}

		100% {
			transform: translateX(-100%);
		}
	}
</style>
<style>
	page {
		background: #EFEFEF;
	}
</style>